package com.yan.jingdongshop.controller;

import com.yan.jingdongshop.services.ServicesImpl;

import java.util.Scanner;

/**
 * @author taoge
 * @Date 2024/8/2 18:32
 * @Description 京东商城
 */
public class Controller {
    public static final Scanner INPUT = new Scanner(System.in);
    public static final ServicesImpl serviceImpl = new ServicesImpl();
    public static void main(String[] args) {
        while (true) {
            System.out.println("********欢迎进入京东商城*********");
            System.out.println("1.添加商品");
            System.out.println("2.查看所有商品");
            System.out.println("3.查看指定编号商品");
            System.out.println("4.添加到购物车");
            System.out.println("5.显示购物车");
            System.out.println("6.退出");
            System.out.println("********************************");
            System.out.println("请选择菜单:");
            int i = INPUT.nextInt();
            switch (i) {
                case 1 -> serviceImpl.addGoods();
                case 2 -> serviceImpl.viewAllGoods();
                case 3 -> serviceImpl.viewAppointGoods();
                case 4 -> serviceImpl.addCart();
                case 5 -> serviceImpl.viewCart();
                case 6 -> System.exit(0);
            }
        }
    }
}
